import express, { Express } from 'express';

import { ChattyServer } from './setupServer';
import databaseConnection from './setupDtatbase';
import { config } from './config';

class Application {
  public initlalize(): void {
    this.localConfig();
    databaseConnection();
    const app: Express = express();
    const server: ChattyServer = new ChattyServer(app);
    server.start();
  }

  private localConfig(): void {
    config.volidateConfig();
    config.cloudinaryConfig();
  }
}

const application: Application = new Application();
application.initlalize();
